var app = getApp();

Page({
    data: {
    },
    qsy: function(t) {
        getApp().sjid = t.currentTarget.dataset.sjid, 
        wx.redirectTo({
            url: "/zh_cjdianc/pages/seller/index"
        });
    },
    onLoad: function(t) {
        app.setNavigationBarColor(this);
        var o = this, a = wx.getStorageSync("users").id;
        app.util.request({
            url: "entry/wxapp/MyCoupons",
            cachetime: "0",
            data: {
                user_id: a
            },
            success: function(t) {
                // t.data[n].time.substr(0,10)
                for (var a = [], e = [], n = 0; n < t.data.length; n++){
                    if ("2" == t.data[n].type){
                        a.push(t.data[n]);   
                    } else if ("1" == t.data[n].type){
                        t.data[n].time = t.data[n].time.substr(0, 10);
                        e.push(t.data[n]);
                    }
                }
                o.setData({
                    ptarr: a,
                    sjarr: e
                });
            }
        });
    },
    dateTime:function(){
        alert(123)
    }
});